import { Routes, Route, Navigate, BrowserRouter } from 'react-router-dom'
import { lazy, Suspense } from 'react'
import { RouteItem } from '../utils/type'

export const HomeRoute: RouteItem[] = [
    {
        id: 1,
        path: '/home/RecommendForYou',
        element: lazy(() => import('../pages/home/RecommendForYou/index')),
        title: '为你推荐'
    },
    {
        id: 2,
        path: '/home/StencilCenter',
        element: lazy(() => import('../pages/home/StencilCenter/index')),
        title: '模版中心'
    },
    {
        id: 3,
        path: '/home/MaterialCenter',
        element: lazy(() => import('../pages/home/MaterialCenter/index')),
        title: '素材中心'
    },
    {
        id: 4,
        path: '/home/CreateDesign',
        element: lazy(() => import('../pages/home/CreateDesign/index')),
        title: '创建设计'
    },
    {
        id: 5,
        path: '/home/workbench',
        element: lazy(() => import('../pages/Workbench/index')),
        title: "首页"
    },
    {
        id: 6,
        path: '/home/TopUp',
        element: lazy(() => import('../pages/TopUp/index')),
        title: "充值哦"
    },
    {
        id: 7,
        path: '/home/OrderForGoods',
        element: lazy(() => import('../pages/OrderForGoods/index')),
        title: "订单"
    },
    {
        id: 8,
        path: '/home/Moban',
        element: lazy(() => import('../pages/Moban/index')),
        title: "模版"
    },
]

const routes = [
    {
        path: '/',
        to: '/home/RecommendForYou'
    },
    {
        path: '/home',
        element: lazy(() => import('../pages/home/index')),
        children: HomeRoute
    },

    {
        path: '/login',
        element: lazy(() => import('../pages/login/index'))
    },
    {
        path: '/personage',
        element: lazy(() => import('../pages/personage/index'))
    },
    {
        path: '/rili/kaixue',
        element: lazy(() => import('../pages/Workbench/components/Top/kaixue/kaixue'))
    },
    {
        path: '/rili/kangri',
        element: lazy(() => import('../pages/Workbench/components/Top/kangri/kangri'))
    },
    {
        path: '/Odyssey',
        element: lazy(() => import('../pages/Odyssey/Odyssey'))
    },
    {
        path: '/Moneycapability',
        element: lazy(() => import('../pages/Moneycapability/Moneycapability'))
    },
    {
        path: '/cai',
        element: lazy(() => import('../pages/cai/car'))
    }, {
        path: '/gaoding',
        element: lazy(() => import('../pages/gaoding/gaoding'))
    },
    {
        path: '*',
        element: lazy(() => import('../pages/error/index'))
        
    },
    {
        path: '/char',
        Element: lazy(() => import('../pages/char/char'))
    },
]
export default routes